Implement VCPUOP_register_vcpu_info
authorJeremy Fitzhardinge <jeremy@xensource.com>
Thu, 24 May 2007 09:47:27 +0000 (10:47 +0100)
committerJeremy Fitzhardinge <jeremy@xensource.com>
Thu, 24 May 2007 09:47:27 +0000 (10:47 +0100)
commitc58ae69360ccf2495a19bf4ca107e21cf873c75b
tree8eaaf886d622b67e4201bc139220bb544713adb4
parent8a981e0bf25e64ba0705e9ce6511a32604078be4
Implement VCPUOP_register_vcpu_info

This change implements the VCPUOP_register_vcpu_info vcpu_op.  This
allows a guest to choose where each VCPU's vcpu_info structure is
placed within its address space, allowing it to put it somewhere which
is easily accessible via some per-cpu data access mechanism.

When changing the mapping of the vcpu info, there's no obvious way to
prevent the other vcpus from getting a stale pointer of the vcpu_info,
which could result in them accessing bad memory (stale pointers to the
shared_info page are not a problem, because its always valid).  To
avoid this, we prevent guests from changing the vcpu_info location
more than once, since there's no obvious need to allow them to do this
at this point.

(If we really want to allow guests to update the vcpu_info location
more than once, then some sort of RCU wait between updating the
pointer and performing the unmap may be the way to do it.)

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
xen/arch/x86/domain.c
xen/common/domain.c
xen/include/public/vcpu.h
xen/include/xen/sched.h